package com.my.netty.dao;

import com.my.netty.entrty.*;
import com.my.netty.nettysub.ChatMsgNetty;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao {

    int deleteByPrimaryKey(String id);
    //根据用户名查找指定用户对象
    User queryUserNameIsExit(String username);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User getUserById(String id);



    //修改用户
    User updateUserInfo(User user);

    //搜索好友的前置条件接口
    Integer preconditionSearchFriends(String myUserId, String friendUserName);

    //发送好友请求
    void  sendFriendRequest(String myUserId,String friendUserName);

    //好友请求列表查询
    List<FriendsRequestVO> queryFriendRequestList(String acceptUserId);

    //处理好友请求——忽略好友请求
    void deleteFriendRequest(FriendsRequest friendsRequest);

    //处理好友请求——通过好友请求
    void passFriendRequest(String sendUserId,String acceptUserId);

    //好友列表查询
    List<MyFriendsVO> queryMyFriends(String userId);

    //保存用户聊天消息
    String saveMsg(ChatMsgNetty chatMsg);

    void updateMsgSigned(List<String> msgIdList);

    //获取未签收的消息列表
    List<ChatMsg> getUnReadMsgList(String acceptUserId);
}
